package widget.common.utils
{
	import flash.display.*;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	public class DisplayObjectUtil
	{
		// Remove all of the children in a container
		public static function clearDisplayContainer(container : DisplayObjectContainer) : void
		{
			if (!container)
				return;
			while (container.numChildren > 0)
			{
				container.removeChildAt(0);
			}
		}
		
		public static function clearBitmap(bitmap : Bitmap) : void
		{
			if (bitmap)
			{
				if (bitmap.bitmapData)
				{
					bitmap.bitmapData.dispose();
					bitmap.bitmapData = null;
				}
				bitmap = null;
			}
		}
	}
}